<template>
  <div class="container_card_order">
    <ul class="list">
      <li
        class="li"
        @click="todetail(item.order_id)"
        v-for="(item,index) in goods_info"
        :key="index"
      >
        <div class="top">
          <span v-if="item.c2c_order_type==2">出售卡项</span>
          <span v-if="item.c2c_order_type==1">购买卡项</span>
          <span class="text" v-if="item.order_status==1">{{item.order_status_name}}</span>
          <span class="text" v-if="item.order_status==2">{{item.order_status_name}}</span>
          <span class="text" v-if="item.order_status==5">{{item.order_status_name}}</span>
          <span class="text" v-if="item.order_status==9">{{item.order_status_name}}</span>
          <span class="text" v-if="item.order_status==8">{{item.order_status_name}}</span>
        </div>
        <!-- 卡样式 -->
        <div class="box" v-if="item.goods_type==1" :style="{background: 'url(' + ImgBaseUrl+item.goods_image + ')', backgroundSize:'100% ,100%'}">
          <div class="right">
            <div class="name">
              {{item.goods_name}}
            </div>
            <div class="describe">
              {{item.goods_describe}}
            </div>
            <div class="price">
              <span class="symbol">¥</span>
              {{item.goods_sale_price}}
            </div>
          </div>
        </div>

        <!-- 券样式 -->
        <div class="ticketbox" v-if="item.goods_type==2">
          <div class="box1">
            <div class="left">
              <div class="title">
                <span class="type">[{{item.goods_sign}}]</span>
                {{item.goods_name}}
              </div>
              <div class="desc">
                {{item.goods_describe}}
              </div>
            </div>
            <div class="right">
              <span class="icon">¥</span>
              {{item.goods_sale_price}}
            </div>
          </div>
        </div>

        <div class="line"></div>
        <div class="info">
          <div class="left">
            时间 &nbsp;
            <span class="span1">
              {{item.ordercreate_time}}
            </span>
            <br />昵称 &nbsp;
            <span class="span1" >{{item.c2c_sale_username}}</span>
          </div>
          <div class="right">
            <span v-if="item.goods_type==1">卡号</span>
            <span v-if="item.goods_type==2" >券号</span> 
            &nbsp;
            <span class="span2">{{item.c2c_sale_id}}</span>
            <br />
            <span class="right">交易金额</span> &nbsp;
            <span class="span2">￥{{item.goods_sale_price}}</span>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import common from "@/assets/js/mmk_common.js";
export default {
   props: {
    goods_info: []
  },
  data() {
    return {
      ImgBaseUrl: common.image_response, //img 域名
      list: this.goods_info,
      timer: "",
      interval: "",
    };
  },
  methods: {
    todetail(e) {
      wx.navigateTo({
        url: "/pages/ct_store/flea_order_detail/main?order_id=" + e
      });
    }
  },
  watch: {

  },
 
  onLoad() {
    clearInterval(this.interval);
    // this.getTimer(this.goods_info.order_expired_time)
  },
  destroyed() {}
};
</script>


<style lang="less" scoped>
.container_card_order {
  background: #f7f7f7;
  padding: 10px 0;
  .list {
    width: 100%;
    box-sizing: border-box;
    background: #f7f7f7;
    .li {
      height: auto;
      box-sizing: border-box;
      padding: 12px 12px 13px;

      background: #fff;
      margin-bottom: 10px;
      &.li:nth-last-of-type(1) {
        margin-bottom: 0;
      }
      .top {
        color: #333333;
        height: 16px;
        line-height: 16px;
        margin-bottom: 12px;
        font-weight: 500;
        .text {
          float: right;
          color: #3EB0A9;
        }
      }
      .box {
        width: 100%;
        height: 155px;
        background-size: 100% 100%;
        padding: 20px;
        box-sizing: border-box;
        color: #fff;
        border-radius:8px;
        .right {
          height: 114px;
          position: relative;
          .name {
            font-size: 18px;
            margin-bottom: 4px;
          }
          .describe {
            font-size: 14px;
            margin-bottom: 53px;
            height: 40px;
            width: 85%;
          }
          .price {
            font-size: 21px;
            font-weight: 500;
            position: absolute;
            bottom: 0;
            left: 0;
            .symbol {
              font-size: 14px;
              margin-right: 1px;
            }
            .icon {
              width: 12px;
              height: 12px;
              display: inline-block;
              border-radius: 50%;
              margin-left: 8px;
              margin-right: 1px;
              vertical-align: middle;
            }
            .text1 {
              color: #f5d040;
              font-size: 10px;
              height: 14px;
              display: inline-block;
              line-height: 14px;
            }
          }
        }
      }
      .ticketbox {
        background: #f3f4f6;
        .box1 {
          height: 121px;
          display: flex;
          background: url("https://mmkapp.oss-cn-beijing.aliyuncs.com/h5_images/mp_images/3.3/ticket_bg.png")
            no-repeat;
          background-size: 100% 100%;
          box-shadow: 1px 2px 3px 2px rgba(240, 240, 240, 1);
          border-radius: 8px;
          .left {
            width: 71.5%;
            padding: 14px;
            box-sizing: border-box;
            border-radius: 8px;

            .title {
              font-size: 14px;
              color: #333333;
              margin-bottom: 10px;
              .type {
                color: #ff383e;
              }
            }
            .desc {
              font-size: 12px;
              color: rgba(153, 153, 153, 1);
              line-height: 17px;
            }
          }
          .right {
            width: 28.5%;
            border-radius: 8px;
            font-size: 21px;
            color: #ff383e;
            // background:#fbfbfb;
            text-align: center;
            box-sizing: border-box;
            padding-top: 41px;
            .icon {
              font-size: 14px;
            }
          }
        }
      }

      .info {
        height: 70px;
        color: #999;
        font-size: 14px;
        box-sizing: border-box;
        padding: 11px 12px 0px;
        line-height: 29px;
        margin-top: 12px;
        display: flex;
        border-top: 1px dashed #ebebeb;
        .left,
        .right {
          width: 50%;
        }
        // .span1 ,.span2{
        //   color: #666;
        // }
        // .right {
        //   margin-left: 20%;
        //   // float: right;
        // }
      }
    }
  }
}
</style>


